Added a toggle Action Button to allow the user to switch the labelling of warnings in the plugin#134
Open
rdaultonGT wants to merge 1 commit intoadvanced-security:mainfrom
Open
Added a toggle Action Button to allow the user to switch the labelling of warnings in the plugin#134rdaultonGT wants to merge 1 commit intoadvanced-security:mainfrom
rdaultonGT wants to merge 1 commit intoadvanced-security:mainfrom
Conversation
…g of warnings in the plugin between RuleId or Description. This is useful for users who prefer to see the RuleId instead of the Description, or vice versa.
adrienpessu
requested changes
Apr 25, 2025
Collaborator
adrienpessu
left a comment
There was a problem hiding this comment.
With few modifications it should work.
Can you also make this toggle saved in the SettingsState
Comment on lines
+59
to
+63
| var key = "init" | ||
| if (view.ruleIdToggle) | ||
| key = result.rule?.id ?: result.correlationGuid?.toString() ?: result.message.text | ||
| else | ||
| key = result.rule?.id ?: result.correlationGuid?.toString() ?: result.ruleId |
Collaborator
There was a problem hiding this comment.
var key = if (view.ruleIdToggle)
(result?.message?.text ?: result.rule?.id ?: result.correlationGuid?.toString())!!
else
(result?.ruleId ?: result.rule?.id ?: result.correlationGuid?.toString())!!
| SwingUtilities.invokeLater { | ||
| val returnValue = fileChooser.showOpenDialog(null) | ||
| if (returnValue == JFileChooser.APPROVE_OPTION) { | ||
| val selectedFile: File = fileChooser.selectedFile |
Collaborator
There was a problem hiding this comment.
Suggested change
| val selectedFile: File = fileChooser.selectedFile | |
| selectedFile = fileChooser.selectedFile |
without that the selectedFile attribute is never initiated and the toggle doesn't refresh the tree
| <resource-bundle>messages.MyBundle</resource-bundle> | ||
|
|
||
| <actions> | ||
| <action id="RuleIDorDescriptionAction" icon="AllIcons.Actions.Diff" class="com.github.adrienpessu.sarifviewer.actions.RuleIDorDescriptionAction" text="Toggle Rule ID or Description"> |
Collaborator
There was a problem hiding this comment.
I found the AllIcons.Actions.Diff misleading.
Could you use a more neutral icon like : AllIcons.Debugger.VariablesTab and make it change color when toggled (using AllIcons.Debugger.Value for example)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added a toggle Action Button to allow the user to switch the labelling of warnings in the plugin between RuleId or Description. This is useful for users who prefer to see the RuleId instead of the Description, or vice versa.